package com.concurrent.chapter2.concurrent01;

import java.util.concurrent.CountDownLatch;

public class MyService {
	private CountDownLatch latch = new CountDownLatch(1);
	public void testMethod() {
		try {
			System.out.println("A");
			latch.await();
			System.out.println("B");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void downMethod() {
		System.out.println("X");
		latch.countDown();
	}
}
